

<a href="index.php?module=VoteDataCenter&type=election&func=report">Election Report</a> 
| <a href="index.php?module=VoteDataCenter&type=election&func=edit">Edit Election Report</a> 
| <a href="index.php?module=VoteDataCenter&type=suratreport&func=pollreport">Poll Report </a>
| <a href="index.php?module=VoteDataCenter&type=suratreport&func=mappoll">Edit Poll Report</a> 
| <a href="index.php?module=VoteDataCenter&type=suratreport&func=report">Scanner Report </a>
<br>
<fieldset>
  <legend>&nbsp;Report&nbsp;filter&nbsp;</legend>
  <form method=post action="<!--[pnmodurl modname='VoteDataCenter' type='suratreport' func='pollreport']-->">
    &nbsp;&nbsp;เขต : 
    <select name="form[khet_id]" id="khet_id">
        <option value="0">ทุกเขต</option>
        <option value="1" <!--[if $smarty.request.form.khet_id == 1]-->SELECTED<!--[/if]-->>เขต1</option>
        <option value="2" <!--[if $smarty.request.form.khet_id == 2]-->SELECTED<!--[/if]-->>เขต2</option>
        <option value="3" <!--[if $smarty.request.form.khet_id == 3]-->SELECTED<!--[/if]-->>เขต3</option>
        <option value="4" <!--[if $smarty.request.form.khet_id == 4]-->SELECTED<!--[/if]-->>เขต4</option>
    </select>&nbsp;&nbsp;

    &nbsp;&nbsp;เบอร์ : 
    <select name="form[vote_no]" id="vote_no">
        <option value="1" <!--[if $smarty.request.form.vote_no == 1]-->SELECTED<!--[/if]-->>เบอร์1</option>
        <option value="2" <!--[if $smarty.request.form.vote_no == 2]-->SELECTED<!--[/if]-->>เบอร์2</option>
        <option value="3" <!--[if $smarty.request.form.vote_no == 3]-->SELECTED<!--[/if]-->>เบอร์3</option>
    </select>&nbsp;&nbsp;
    <input type="submit" value="submit">
  </form><br>



<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: Info Window Simple</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">


function detectBrowser() {
  var useragent = navigator.userAgent;
  var mapdiv = document.getElementById("map_canvas");
    
  if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1 ) {
    mapdiv.style.width = '100%';
    mapdiv.style.height = '100%';
  } else {
    mapdiv.style.width = '100%';
    mapdiv.style.height = '800px';
  }
}
/*
  google.load('maps', '2');
  var map;

  function initialize() {

    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(37.4328, -122.077), 12);

    // The following line makes the map Earth-enabled by adding the
    // "Earth" button to the map type control.  Note that you still
    // need to add a map type control (GMapTypeControl,
    // GMenuMapTypeControl, or GHierarchicalMapTypeControl) to the
    // the map (as is done below) for the "Earth" button and the rest
    // of the map type buttons to show up at all.
    map.addMapType(G_SATELLITE_3D_MAP);

    map.addControl(new GHierarchicalMapTypeControl());
    map.addControl(new GLargeMapControl());
    
    var marker = new GMarker(new GLatLng(37.4228, -122.085));
    GEvent.addListener(marker, "click", function() {
      var html = '<div style="width: 210px; padding-right: 10px">Hello world!<\/div>';
      marker.openInfoWindowHtml(html);
    });
    map.addOverlay(marker);
  }
*/

  function initialize() {
  
    detectBrowser();
    //$selected, $notselected
    var myLatlng = new google.maps.LatLng(13.759127,100.565185);
    var myOptions = {
      scrollwheel: false,
      zoom: 11,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.HYBRID
    }

    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    //'http://www.google.com/mapfiles/marker.png'
    var poverty = [
                     <!--[foreach from=$objectArray item=item]-->
                      [
                        '<!--[$item.id]-->', 
                        '<!--[$item.house_no]-->', 
                        <!--[$item.latitude]-->,
                         <!--[$item.longitude]-->, 
                        <!--[$item.id]-->,
                      'http://maps.gstatic.com/intl/th_ALL/mapfiles/ms/micons/rangerstation.png'
                      ],
                     <!--[/foreach]-->
                  ];

      setMarkers(map, poverty);
    }

function makeMarker(imageName){
  //alert(imageName);
  var iconImage = new google.maps.MarkerImage(imageName,
      // This marker is 20 pixels wide by 34 pixels tall.
      new google.maps.Size(20, 34),
      // The origin for this image is 0,0.
      new google.maps.Point(0,0),
      // The anchor for this image is at 9,34.
      new google.maps.Point(9, 34));
    return iconImage;
}

function makeShadow(){
  var iconShadow = new google.maps.MarkerImage('http://www.google.com/mapfiles/shadow50.png',
      // The shadow image is larger in the horizontal dimension
      // while the position and offset are the same as for the main image.
      new google.maps.Size(37, 34),
      new google.maps.Point(0,0),
      new google.maps.Point(9, 34));
    return iconShadow;
}
  
  function setMarkers(map, locations) {

    for (var i = 0; i < locations.length; i++) {
      var data = locations[i];
      var myLatLng = new google.maps.LatLng(data[2], data[3]);
     var marker = new google.maps.Marker({
          position: myLatLng,
          map: map,
          //shadow: makeShadow(),
          icon: data[5],
          //shape: shape,
          title: data[0],
          zIndex: data[4]
      });

                   
    var contentString = data[1];
        
    var infowindow = new google.maps.InfoWindow({
        content: contentString
    });
    
    //google.maps.event.addListener(marker, 'click', function() {
    //  infowindow.open(map,marker);
    //});
    
    
    google.maps.event.addListener(marker, 'click', infoCallback(infowindow, marker));
    
    }
    
    function infoCallback(infowindow, marker) {
      return function() {
      infowindow.open(map, marker);
  };
}
  }


</script>
</head>

<body onload="initialize()">
<fieldset>
  <legend>&nbsp;Province&nbsp;Map&nbsp;</legend>
  <div id="map_canvas" style="position:relative;"></div>
</fieldset><BR>


</fieldset>
    <!--[if $objectArray]-->
      <fieldset>
        <legend>&nbsp;Data&nbsp;</legend>
          <table border="1" width="100%">
            <tr align="center">
              <th>house_no</th>
              <th>khet</th>
              <th>unit</th>
              <th>เลือกเบอร์</td>
            </tr>
           <!--[foreach from=$objectArray item=item]-->
            <tr align="center">
              <td align="left">&nbsp;&nbsp;<!--[$item.house_no]--></td>
              <td><!--[$item.khet]--></td>
              <td><!--[$item.unit]--></td>
              <td><!--[$item.vote_no]--></td>
            </tr>
            <!--[/foreach]-->
        </table><br>
      </fieldset>
    <!--[/if]-->

  </body>
</html>